package org.moze.controller;

import org.moze.annotation.KthLog;
import org.moze.pojo.TbUser;
import org.moze.service.UserService;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @KthLog("这里是日志内容")
    @RequestMapping("user")
    public TbUser findUser(@RequestParam(required = false) Integer id) {
        return userService.findUserById(id);
    }
}
